package com.xjie.mall.goods.controller;


import com.xjie.mall.common.Result;
import com.xjie.mall.goods.model.SkuAttribute;
import com.xjie.mall.goods.service.SkuAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品属性表 前端控制器
 * </p>
 *
 * @author xjie
 * @since 2025-10-17
 */
@RestController
@RequestMapping("/skuAttribute")
public class SkuAttributeController {

    @Autowired
    private SkuAttributeService skuAttributeService;

    /***
     * 根据分类ID查询属性列表
     */
    @GetMapping(value = "/category/{id}")
    public Result<List<SkuAttribute>> categoryAttributeList(@PathVariable(value = "id")Integer id){
        //根据分类ID查询属性参数
        List<SkuAttribute> skuAttributes = skuAttributeService.queryList(id);
        return Result.success(skuAttributes);
    }
}
